package com.hnkywl.sts.entity.zjgl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.organ.Khh;
import com.hnkywl.sts.entity.organ.Nbgs;
import com.hnkywl.sts.entity.sfgl.Sfk;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 说明：票据管理
 * 包:        com.hnkywl.sts.entity.zjgl
 * 类描述:    票据管理
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Entity
@Table(name = "T_BIZ_PJDR")
@Where(clause = "deleted!='1'")
public class Pjdr extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqPjdr", allocationSize = 1, sequenceName = "SEQ_BIZ_PJDR")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqPjdr")
    private Long id;

    /**
     * 公司名称
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="NBGS_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Gsjg nbgs;

    /**
     * 票据收付类型    0 应收票据  1 应付票据
     */
    private Integer pjsflx;


    /**
     * 票据类型     0 银票  1 商票
     */
    private Integer pjlx;

    /**
     * 票据状态  2.已贴现 3.已托收  4承兑
     */
    private Integer status;

    /**
     * 到期金额
     */
    private Double dqje;

    /**
     * 贴现承兑导入关联的票据
     */
    @OneToMany(fetch = FetchType.LAZY, targetEntity = Pj.class, mappedBy = "pjdr")
    @NotFound(action = NotFoundAction.IGNORE)
    private List<Pj> pjList;


    /**
     * 导入使用
     */
    @Transient
    private String czzt;



    /**
     * 会计年
     */
    @Column(name = "jiuqi_acctyear")
    private Integer acctyear;
    /**
     * 生成久其凭证时提供的ID
     */
    @Column(name = "jiuqi_uuid")
    private String uuid;
    /**
     * 久其返回的凭证ID
     */
    @Column(name = "jiuqi_voucher_id")
    private String voucherId;
    /**
     * 久其返回的凭证号
     */
    @Column(name = "jiuqi_voucher_num")
    private Integer voucherNum;
    /**
     * “久其插入标示”代码   1=未导入,2=导入开始,3=导入成功
     */
    @Column(name = "jiuqi_insert_flag")
    private Integer insertFlag = 1;
    /**
     * "久其删除标示”代码   1=未删除,2=删除开始,3=删除成功
     */
    @Column(name = "jiuqi_delete_flag")
    private Integer deleteFlag = 1;

    private String bz;

    @Transient
    private String pjhm;

    //初始化字段  凡是从老系统导入的为初始化字段  置为 1  其他为非初始化
    private String csh ;

    /**
     * 入账银行
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="RZYH_ID")
    @NotFound(action = NotFoundAction.IGNORE)
    private Khh rzyh;

    /**
     * 导入日期
     */
    private Date drrq;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Gsjg getNbgs() {
        return nbgs;
    }

    public void setNbgs(Gsjg nbgs) {
        this.nbgs = nbgs;
    }

    public Integer getPjsflx() {
        return pjsflx;
    }

    public void setPjsflx(Integer pjsflx) {
        this.pjsflx = pjsflx;
    }

    public Integer getPjlx() {
        return pjlx;
    }

    public void setPjlx(Integer pjlx) {
        this.pjlx = pjlx;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Double getDqje() {
        return dqje;
    }

    public void setDqje(Double dqje) {
        this.dqje = dqje;
    }


    public String getCzzt() {
        return czzt;
    }

    public void setCzzt(String czzt) {
        this.czzt = czzt;
    }

    public Integer getAcctyear() {
        return acctyear;
    }

    public void setAcctyear(Integer acctyear) {
        this.acctyear = acctyear;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getVoucherId() {
        return voucherId;
    }

    public void setVoucherId(String voucherId) {
        this.voucherId = voucherId;
    }

    public Integer getVoucherNum() {
        return voucherNum;
    }

    public void setVoucherNum(Integer voucherNum) {
        this.voucherNum = voucherNum;
    }

    public Integer getInsertFlag() {
        return insertFlag;
    }

    public void setInsertFlag(Integer insertFlag) {
        this.insertFlag = insertFlag;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public List<Pj> getPjList() {
        return pjList;
    }

    public void setPjList(List<Pj> pjList) {
        this.pjList = pjList;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public String getPjhm() {
        return pjhm;
    }

    public void setPjhm(String pjhm) {
        this.pjhm = pjhm;
    }

    public String getCsh() {
        return csh;
    }

    public void setCsh(String csh) {
        this.csh = csh;
    }

    public Khh getRzyh() {
        return rzyh;
    }

    public void setRzyh(Khh rzyh) {
        this.rzyh = rzyh;
    }

    public Date getDrrq() {
        return drrq;
    }

    public void setDrrq(Date drrq) {
        this.drrq = drrq;
    }
}
